import request from '@/utils/request'


export function getConferenceRoomManagement(pageNum,pageSize) {
  return request({
    url: `/administrative/getMeetingRoomsAll/${pageNum}/${pageSize}`,
    method: 'get',
  })
}

export function getMeetingRoomsId(id) {
  return request({
    url: `/administrative/getMeetingRoomsId/${id}`,
    method: 'get',
  })
}

export function deleteMeetingRooms(id) {
  return request({
    url: `/administrative/deleteMeetingRooms/${id}`,
    method: 'delete',
  })
}

export function addMeetingRooms(addMeetingRoomsList) {
  console.log(addMeetingRoomsList)
  return request({
    url: `/administrative/addMeetingRooms`,
    method: 'Post',
    data:addMeetingRoomsList
  })
}

export function updateMeetingRooms(updateAdministrativeList) {
  console.log(updateAdministrativeList)
  return request({
    url: `/administrative/updateMeetingRooms`,
    method: 'PUT',
    data:updateAdministrativeList
  })
}



// 解决ERROR ResizeObserver loop completed with undelivered notifications.
// 重写ResizeObserver的构造函数，并在其中定义并调用防抖函数
window.ResizeObserver = class ResizeObserver extends window.ResizeObserver {
  constructor(callback) {
    let timer = null;
    const debouncedCallback = function () {
      let context = this;
      let args = arguments;
      clearTimeout(timer);
      timer = setTimeout(function () {
        callback.apply(context, args);
      }, 16);
    };
    super(debouncedCallback);
  }
};
